from abc import ABC, abstractmethod
from typing import List
import numpy as np
from models.data_models import DetectionResult

class IDetector(ABC):
    """目标检测器接口"""
    
    @abstractmethod
    def load_model(self, weights_path: str) -> None:
        """加载模型权重"""
        pass
    
    @abstractmethod
    def detect(self, image: np.ndarray, image_path: str = "") -> DetectionResult:
        """检测图像中的目标"""
        pass
    
    @abstractmethod
    def set_confidence_threshold(self, threshold: float) -> None:
        """设置置信度阈值"""
        pass
